<?
session_start();
include('../config.php');
require_once('../classes/class.jira.php');
include("../classes/connect.php");
ini_set('display_errors', 'On');
//include('../header.php');


   function getDisplay($username,$pass,$host){
        $config->username= $username;
        $config->password= $pass;
        $config->port= "";
        $config->host= $host;

        $queryIssue = new Jira($config);
        $array=$queryIssue->getUser($username);
        $response = json_decode($array->responseBody);
        return $response;
        }
?>
   
    <link rel="stylesheet" href="../css/header.css" type="text/css" media="all">  
    <link href="examples/content/shared/styles/examples-offline.css" rel="stylesheet">
        <link href="examples/content/shared/styles/kendo.common.min.css" rel="stylesheet">
        <link href="examples/content/shared/styles/kendo.rtl.min.css" rel="stylesheet">
        <link href="examples/content/shared/styles/kendo.default.min.css" rel="stylesheet">
        <script src="js/jquery.min.js"></script>
        <script src="js/kendo.web.min.js"></script>
        <script src="js/console.js"></script>
         <link href="styles/kendo.dataviz.min.css" rel="stylesheet">
          <script src="js/kendo.dataviz.min.js"></script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JIRA COMMUNI</title>
<link href="../css/demo.css" rel="stylesheet" type="text/css" />
<!--<link rel="stylesheet" type="text/css" href="paginate/styles/style.css" />-->
</head>
<body class="sonata-bc" >
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid header-bar-container">
                <div class="header-bar-top">
                    <a class="brand">
                        <img src="images/logo_white.png" alt="JiraPortal">Recruitment Application      
                    </a>
                </div>
            </div>

            <div class="container-fluid">
                <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="nav-collapse">
                    <ul class="nav" id="menu" style="background-color: #1C2326">
                        <li class="active">
                            <a href="../home.php">Applications</a>
                        </li>
                        <li >
                            <a class="dropdown-toggle" data-toggle="dropdown" href="reportdash.php"> Reports</a> 
                        </li>
                        
                         <li >
                            <a class="dropdown-toggle" data-toggle="dropdown" href="delayreport.php"> Delay Reports</a> 
                        </li>

                        <div class="navbar-text" style="top: 18px;">
                          
                    <p style="color: #FFFFFF;font-size: 15px;font-weight: 100;"> Welcome <?php

                            $display=  getDisplay($username, $pass, $host);
                           echo $display->displayName;
                        
                        ?> [ <a href="logout.php">Logout</a> ]<p>
                </div>
            </div>
        </div>

        </div>
    </div>
        <div id="chartyear"></div>
         
     <script>
        var stocksDataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url:"ajaxdelayreport.php",
                    dataType: "json"
                }
            },

            group: {
                field: "symbol"
            },

            sort: {
                field: "date",
                dir: "asc"
            }
        });

        function createChart() {
            $("#chartyear").kendoChart({
                title: { text: "Year Summary - <?php echo  date('Y');?> " },
                dataSource: stocksDataSource,
                series: [{
                    type: "column",
                    field: "no",
                    name: "#= group #"
                }],
                legend: {
                    position: "bottom"
                },
                valueAxis: {
                    labels: {
                        format: "{0}",
                        skip: 2,
                        step: 20
                    }
                },
                categoryAxis: {
                    field: "date",
                    
                }
            });
        }

        $(document).ready(createChart);
        $(document).bind("kendo:skinChange", createChart);
    </script>

    
        
</body>
</html>
